package pemks.util;

import java.sql.*;

import static pemks.ServerStarter.*;

/**
 * @description:  
 * @author kl
 * @date 2025/4/4 下午9:28
 * @version 1.0
 */
public class DBUtil {


    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection(DB_URL, DB_USER, DB_PASS);
    }

    public static void close(Connection conn, Statement stmt, ResultSet rs) {
        try { if (rs != null) rs.close(); } catch (SQLException e) {}
        try { if (stmt != null) stmt.close(); } catch (SQLException e) {}
        try { if (conn != null) conn.close(); } catch (SQLException e) {}
    }
}
